package com.sa.oauth.mapper;

import com.sa.oauth.entity.SysPerson;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysPersonMapper {
    /**
     * 根据账号查询用户信息
     *
     * @param account 账号
     * @return 用户信息
     */
    @Select("select * from YTHDB.YTH_SYS_PERSON where account = #{account} and delete_flag=0 ")
    SysPerson selectByAccount(String account);

    @Select("select * from YTHDB.YTH_SYS_PERSON where id = #{id} and delete_flag=0 ")
    SysPerson selectById(long id);
    /**
     * 根据openid查询用户信息
     *
     * @param openid openid
     * @return 用户信息
     */
    @Select("select * from YTHDB.YTH_SYS_PERSON where open_id = #{openid} and delete_flag=0 ")
    SysPerson getByOpenid(String openid);
}
